<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title>ERP进销存管理系统</title>
		<link rel="stylesheet" type="text/css" href="main.css" />
	</head>
	<body>
		<table class="tableborder" cellspacing="1" cellpadding="4" width="99%" align="center">
			<tr>
				<td class="header">新增用户</td>
			</tr>
			<tr>
				<td class="altbg2" align="center">
					<a href="power!add.do">添加新用户</a>
				</td>
			</tr>
		</table>
		<br/>
		<table class="tableborder" cellspacing="1" cellpadding="4" width="99%" align="center">
			<tr>
				<td colspan="8" class="header">用户管理</td>
			</tr>					
			<tr class="altbg1" align="center">
				<td width="20%">ID号</td>
				<td width="20%">姓名</td>
				<td width="20%">密码</td>
				<td width="20%">角色</td>
				<td width="10%">禁用/启用</td>
				<td width="10%">操作</td>
			</tr>
			<s:iterator value="pager.resultList">
			<tr class="altbg2" align="center">
				<td><s:property value="employeeid"/></td>
				<td><a href="power!edit.do?uid=${id}"><s:property value="name"/></a></td>
				<td>
					<a href="power!setdefault.do?uid=${id}">设为默认</a>
				</td>
				<td>
					<s:if test="${role.id}==1">系统管理员</s:if>
					<s:elseif test="${role.id}==2">采购人员</s:elseif>
					<s:elseif test="${role.id}==3">采购主管</s:elseif>
					<s:elseif test="${role.id}==4">总经理</s:elseif>
					<s:elseif test="${role.id}==5">元器件库管员</s:elseif>
					<s:elseif test="${role.id}==6">成品库管理员</s:elseif>
					<s:elseif test="${role.id}==7">销售主管</s:elseif>
					<s:elseif test="${role.id}==8">销售人员</s:elseif>
				</td>
				<td>
					<s:if test="${enabled}==1">启用</s:if>
					<s:else>停用</s:else>
				</td>
				<td>
				<a  href="power!edit.do?uid=${id}">修改</a>
				<a href="power!del.do?uid=${id}">删除</a>
				</td>
			</tr>
			</s:iterator>
		</table>
		
	<s:form action="power!list.do" method="post" name="form1">	
		<table border="0" width="100%" class="pager">
			<tr>
				<td align="left">每页记录数：
					<s:select name="pageSize" key="pager.pageSize" list="pager.pageSizeIndexs" value="pager.pageSize" onchange="document.all.pageNo.value='1';document.all.form1.submit();"/>
				</td>
				<td align="center">
				总记录数：<s:property value="pager.rowCount" />
				</td>
				<td align="right">
					<a href="javascript:document.all.pageNo.value='<s:property value="pager.firstPageNo" />';document.all.form1.submit();">首页</a>
					<a href="javascript:document.all.pageNo.value='<s:property value="pager.prePageNo" />';document.all.form1.submit();">前一页</a>
					<a href="javascript:document.all.pageNo.value='<s:property value="pager.nextPageNo" />';document.all.form1.submit();">后一页</a>
					<a href="javascript:document.all.pageNo.value='<s:property value="pager.lastPageNo" />';document.all.form1.submit();">尾页</a>
					<s:select name="pageNo" list="pager.pageNoIndexs" value="pager.pageNo" onchange="document.all.form1.submit();"/>
				</td>
				<td width="20"></td>
			</tr>
		</table>
	</s:form>
	</body>
</html>